package com.pc.cloud.core;


import com.pc.cloud.anlysis.OneCharAnalyzer;

public class SearchManagerFactory {
	public synchronized static SearchManager createSearchManager(String searchType,Boolean isOnFile) throws Exception {
		LuceneSettings settings  = new LuceneSettings(searchType);
		if (isOnFile != null && isOnFile) {
			settings.setOnRam(false);
		}
		settings.init();
		settings.setAnalyzer(new OneCharAnalyzer());
		LuceneSearchManager sm = new LuceneSearchManager();
		sm.setSettings(settings);
		sm.init();		
		return sm;
	}
}
